﻿using offline2048;
using UnityEngine;

public class TutorialPanel : MonoBehaviour
{
    public GameObject FirstColumnButton;
    public GameObject SecondColumnButton;
    public GameObject ThirdColumnButton;

    private void OnEnable()
    {
        transform.SetSiblingIndex(4);

        GameManager.instance.CreateCurrentCell(1);
    }

    public void FirstClick()
    {
        GameManager.instance.OnColumnClick(1);
        FirstColumnButton.SetActive(false);
        
        LeanTween.delayedCall(1f, () =>
        {
            GameManager.instance.CreateCurrentCell(1);
            SecondColumnButton.SetActive(true);
        });
    }

    public void SecondClick()
    {
        GameManager.instance.OnColumnClick(2);
        SecondColumnButton.SetActive(false);

        LeanTween.delayedCall(1f, () =>
        {
            GameManager.instance.CreateCurrentCell(1);
            ThirdColumnButton.SetActive(true);
        });
    }

    public void ThirdClick()
    {
        GameManager.instance.OnColumnClick(3);

        gameObject.SetActive(false);
    }
}
